import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}

export function getInfo(data) {
  return request({
    url: '/newsType/pageInfo',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/admin/loginOut',
    method: 'post'
  })
}


export function getUserListApi(data) {
  return request({
    url: '/user/pageInfo',
    method: 'post',
    data
  })
}

export function changeStateApi(data) {
  return request({
    url: '/user/changeState',
    method: 'post',
    data
  })
}

export function setScoreApi(data) {
  return request({
    url: '/user/setScore',
    method: 'post',
    data
  })
}

export function createUserApi(data) {
  return request({
    url: '/user/create',
    method: 'post',
    data
  })
}

export function getUserDetailApi(id) {
  return request({
    url: `/user/detail/${id}`,
    method: 'post',
  })
}

export function saveUserApi(data) {
  return request({
    url: `/user/save`,
    method: 'post',
    data
  })
}

export function deleteUserApi(data) {
  return request({
    url: `/user/batchDelete`,
    method: 'post',
    data
  })
}

export function getUserCertificateIdDetail(userId, certId) {
  return request({
    url: `/app/getUserCertificateIdDetail/${userId}/${certId}`,
    method: 'post',
  })
}

export function exportCreateApi(data) {
  return request({
    url: `/export/create`,
    method: 'post',
    data
  })
}
